//
//  MeInfoView.m
//  HJZWeiBo
//
//  Created by 蒋晨成 on 16/5/29.
//  Copyright © 2016年 蒋晨成. All rights reserved.
//

#import "MeInfoView.h"
#import <UIButton+WebCache.h>

@implementation MeInfoView

/*
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect {
    // Drawing code
}
 
*/

- (void)setUser:(WeiboUser *)user {
    _user = user;
    
    
    _iconButton.layer.cornerRadius = 30;
    _iconButton.layer.masksToBounds = YES;
    [_iconButton sd_setImageWithURL:[NSURL URLWithString:user.avatarHDUrl] forState:UIControlStateNormal];
    
    
    _nameLabel.text = user.name;
    [_guanzhuButton setTitle:[NSString stringWithFormat:@"关注 %@", user.friendsCount] forState:UIControlStateNormal];
    [_fensiButton setTitle:[NSString stringWithFormat:@"粉丝 %@", user.followersCount] forState:UIControlStateNormal];
  
    [_desriptionButton setTitle:[NSString stringWithFormat:@"简介：%@", user.userDescription] forState:UIControlStateNormal];
    
}

- (IBAction)iconButtonAction:(UIButton *)sender {
    
    
}
- (IBAction)guanzhuButtonAction:(UIButton *)sender {
    if ([self.delegate respondsToSelector:@selector(pushFollowingUser)]) {
        [self.delegate pushFollowingUser];
    }
    
}
- (IBAction)fensiButtonAction:(UIButton *)sender {
    if ([self.delegate respondsToSelector:@selector(pushFollowByUser)]) {
        [self.delegate pushFollowByUser];
    }
    
}
- (IBAction)descriptionButtonAction:(UIButton *)sender {
    
}

@end
